package tcln.sors.client.core.mvc;

import java.util.Map;

/**
 * Interface for an application controller (which is used to lookup other controllers) of an application.
 * 
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 */
public interface ApplicationController {

    /**
     * Returns a controller for a given standard type and all additional parameters.
     * 
     * @param type
     *            A standard type.
     * @param parameters
     *            All additional parameters. For example, a "deetail" controller would require a parameter 'id'.
     * @return A controller for given context.
     */
    Controller getFor(StandardControllerType type, Map<String, Object> parameters);

    /**
     * Returns a controller for a given type and all additional parameters.
     * 
     * @param type
     *            Controller type, compared with {@link Controller#getType()}.
     * @param parameters
     *            All additional parameters. For example, a "deetail" controller would require a parameter 'id'.
     * @return A controller for given context.
     */
    Controller getFor(String type, Map<String, Object> parameters);
}
